<%--
  Created by IntelliJ IDEA.
  User: 六处
  Date: 2021/7/25
  Time: 9:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/add.css"/>
</head>
<body>
<div id="app">
    <div class="header">
        <span>删除快递员</span>
    </div>
    <div class="content">
        <table>
            <tr>
                <td class="text-right">手机号码</td><td class="content_right"><input class="input inline-input" placeholder="请输入手机号码"> <span class="btn btn-info" onclick="form01Submit()">立即查找</span></td>
            </tr>
        </table>
    </div>


    <div class="header">
        <span>查找信息如下</span>
    </div>
    <div class="content" id="content">
        <table>
            <tr>
                <td class="text-right">姓名</td><td class="content_right"><input class="input" placeholder="姓名" disabled></td>
            </tr>
            <tr>
                <td class="text-right">手机号码</td><td class="content_right"><input class="input" placeholder="手机号码" disabled></td>
            </tr>
            <tr>
                <td class="text-right">身份证号码</td><td class="content_right"><input class="input" placeholder="身份证号码" disabled></td>
            </tr>
            <tr>
                <td class="text-right">密码</td><td class="content_right"><input class="input" placeholder="密码" disabled></td>
            </tr>
            <tr>
                <td></td><td class="content_right"><span class="btn btn-info" onclick="confirm()">立即删除</span> <span class="btn" onclick="reset()">重置</span> </td>
            </tr>
        </table>
        <input type="hidden"  />
    </div>
</div>
<script src="../../js/jquery-1.11.1.js"></script>
<script src="../../layer/layer.js"></script>
<script src="../../assets/layui.all.js"></script>
<script>
    $(function () {
        reset();
    });

    function reset() {
        $("input").val("");
        $("#content").css("display", "none");
    }

    function form01Submit() {
        var windowId = layer.load(5);
        var num = $("input:eq(0)").val();
        num = $.trim(num);
        $.post("/admin/findByPhone.do", {
            phone: num
        }, function (data) {
            layer.close(windowId);
            if (data["msgCode"] == 200) {
                $("#content").css("display", "");
                $("input:eq(1)").val(data["dataList"][0]["adminName"]);
                $("input:eq(2)").val(data["dataList"][0]["phone"]);
                $("input:eq(3)").val(data["dataList"][0]["cardId"]);
                $("input:eq(4)").val(data["dataList"][0]["adminPwd"]);
                $("input:eq(5)").val(data["dataList"][0]["adminId"]);
                layer.alert("成功查寻到此快递员！٩(๑>◡<๑)۶ ");
            } else if (data["msgCode"] == 400) {
                layer.alert("未查到此快递员！(〒︿〒)");
            }
        }, "json");
        return false;
    }

    function confirm() {
        layer.confirm("确定要删除嘛？", {tittle: "删除确认"}, function () {
            var windowId = layer.load();
            var num01 = $("input:eq(5)").val();
            num01 = $.trim(num01);
            $.post("/admin/delete.do", {
                id: num01
            }, function (data) {
                layer.close(windowId);
                if (data["msgCode"] == 200) {
                    layer.alert("删除成功~   ヾ(^Д^*)/");
                } else {
                    layer.alert("删除失败了  (；´д｀)ゞ");
                }
            }, "json");
            return false;
        })
    }


</script>
</body>
</html>


